Server Watch Plugin SDK | Date: 6 Feb 2004 Release: 1.0 |
#include <SWPluginServerStruct.h>
Public Member Functions | |
Constructor | |
SWPluginServerStruct (const SWHandle &handle, const wchar_t *regBase) | |
Public Attributes | |
Server Watch Defined Variables | |
Server Watch will create all of the following classes and variables that are related to the server. | |
const SWHandle | swhHandle |
The server identifier. | |
ISWServerData * | pServerData |
The class that maintains the standard runtime data associated with the server. | |
ISWServerSettings * | pSettings |
The class that maintains the standard server settings as set by the end user. | |
const std::wstring | strRegistryBase |
The string that identifies where the plugin can store information in the registry that is associated with the server. | |
Plugin Defined Variables | |
The plugin writer may and set the following variables related to the server. Otherwise they will be NULL; | |
void * | pCustomData |
This variable is designed to give plugin writers a place to store plugin specific server information. |
|
Default Constructor. Do not create one of these in the plugin. |
|
The server identifier. This handle identifies the server in a globally unique manner. This allows servers to be passed between computers without causing confusion. Use this handle if you need to identify the specific server associated with the SWPluginServerStruct. |
|
The class that maintains the standard runtime data associated with the server. The runtime data is any data that is gathered about the current state of the server. You should set this information during Server Watch's call to the Ping() function. |
|
The class that maintains the standard server settings as set by the end user.
|
|
The string that identifies where the plugin can store information in the registry that is associated with the server.
The ISWServerSettings class will maintain its own settings in the registry, however, if the plugin needs to save it's own settings, it should use the DFRegTool and pass this string into the DFRegTool::Open() function. For Example: |
|
This variable is designed to give plugin writers a place to store plugin specific server information. A plugin writer can set this variable to any structure or class that they wish. By default this variable will be NULL unless set by the plugin on the call to InitServer(). Once this has been done, the structure or class will be pernamently associated to the server and will be in the SWPluginServerStruct on subsequent calls by Server Watch that have the structure passed into it and are asspociated to this server.
SWRESULT InitServer(SWPluginServerStruct* pThisServer) { pThisServer->pCustomData = (void*) new MyCustomClass; } SWRESULT CleanupServer(SWPluginServerStruct* pThisServer) { delete pThisServer->pCustomData; pThisServer->pCustomData = NULL; } SWRESULT UseCustomData(SWPluginServerStruct* pThisServer) { MyCustomClass *pMyClass = (MyCustomClass*)pThisServer->pCustomData; pMyClass->DoSomething(); } If you intend to use the structure or class associated with pCustomData in either the Ping() function or your own threaded functions, this class must be thread safe or otherwise have some thread safety mechanism to protect the data within from corruption caused by thread race conditions.
|
Copyright (c) 2003-2004, Deep Fried Software. All rights reserved. |